﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Main2Cloumn.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="Sotipha.Web.Views.Cart.Default" %>

<%@ Register Src="../Home/ucFeatureProduct.ascx" TagName="ucFeatureProduct" TagPrefix="uc1" %>
<%@ Register Src="../Home/ucNewArrival.ascx" TagName="ucNewArrival" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainRightLeftTop" runat="server">
    <uc1:ucFeatureProduct ID="ucFeatureProduct1" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderBotton" runat="server">
    <uc2:ucNewArrival ID="ucNewArrival1" runat="server" />
    <style>
        .trSuccessful
        {
            display: none;
        }
       #btnClose
        {
            display: none;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainRight" runat="server">
    <link href="Css/cart.css" rel="stylesheet" type="text/css" />
    <script src="Js/view.cart.js" type="text/javascript"> </script>
    <div class="divtt">        
        <asp:Literal ID="ltrShoppingBag" runat="server" Text="Shopping bag"></asp:Literal>
        </div>
    <div class="content" style="padding-top: 20px">
        <asp:Literal ID="ltrCart" runat="server"></asp:Literal>
        <div class="btn">
            <input type="button" class="btncontinuashopping" value=""><input type="button" class="btnpayment confirm"
                value=""></div>
        <div class="total">
            <asp:Literal ID="ltrTotal" runat="server"></asp:Literal></div>
        <div id="div1" class="show" style="position: fixed; width: 100%; height: 100%; background: #000;
            opacity: 0.5; top: 0; left: 0">
        </div>
        <div id="div2" class="show" style="position: fixed; top: 30%; left: 0; width: 100%">
            <div class="forminput" id="FormOrder" style="padding-top: 30px; height: 200px; width: 400px;
                background: #fff; margin: 0 auto">
                <a class="closebtn" style="position: absolute; margin-left: 390px; margin-top: -40px">
                    <img src="../../../images/closebtn.png" /></a>
                <table>
                    <tr class="trInfo">
                        <td>
                            <label>
                                <asp:Literal ID="ltrFullname" runat="server">Fullname</asp:Literal>:</label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtName" runat="server" Text="" CssClass="input" data-field="CustomerName"
                                ClientIDMode="Static"></asp:TextBox>
                        </td>
                    </tr>
                    <tr class="trInfo">
                        <td>
                            <label>
                                <asp:Literal ID="ltrPhone" runat="server">Phone</asp:Literal>:</label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtPhone" runat="server" Text="" CssClass="input" data-field="Phone"
                                ClientIDMode="Static"></asp:TextBox>
                        </td>
                    </tr>
                    <tr class="trInfo">
                        <td>
                            <label>
                                <asp:Literal ID="ltrAddress" runat="server">Address</asp:Literal>
                                :</label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtAddress" runat="server" Text="" CssClass="input" data-field="Address"
                                ClientIDMode="Static"></asp:TextBox>
                        </td>
                    </tr>
                    <tr class="trInfo">
                        <td>
                            <label>
                                E-mail:</label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtEmail" runat="server" Text="" CssClass="input" data-field="Email"
                                ClientIDMode="Static"></asp:TextBox>
                        </td>
                    </tr>
                    <tr class="trSuccessful">
                        <td>
                            <label>
                                Bạn đã đặt hàng thành công</label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <input type="button" class="btnsubmit" id="btnSave" value="" onclick="SaveOrder()" />
                            <input type="button" class="btnTransparent" id="btnClose" value="Đóng"  />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <script language="javascript">
        function changeQuanlity(idObject) {
            var nQuality = $('#input_item_' + idObject).val();
            debugger;
            var intRegex = /^\d+$/;
            if(intRegex.test(nQuality)){
                nQuality = nQuality <= 0 ? 1 : nQuality;
                $.ajax({
                    type: "POST",
                    url: 'Default.aspx',
                    data: "ID=" + idObject + "&num=" + nQuality,

                    success: function(resultData) { $('.total').html(resultData); },
                    //dataType: dataType
                });
                return;
            }
            $('#input_item_' + idObject).val(1);
            return;

            //content
        }

        $(document).ready(function() {
            $('input').keydown(function(e) {
                var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
                if (key == 13) {
                    e.preventDefault();

                }
            });
            $("[input^='input_item_']").live("keyup", function(event) {
                if (event.keyCode == '13') {
                    //do nothing
                    console.log('aaa');

                }
                //var currentId = $(this).attr('id');
                //alert(currentId);
            });
        });
    </script>
</asp:Content>
